import Vue from 'vue'
import Router from 'vue-router'
import Login from './views/Login.vue'
import Home  from "./views/Home";
import Test1 from "./views/Test1";
import Test2 from "./views/Test2";
import FriendChat from "./views/chat/FriendChat";

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login,
      hidden: true  //遍历的时候  是一个标记 等遍历的时候根据这个来判断是否隐藏
    }, {
      path: '/home',
      name: 'Home',
      component: Home,
      hidden: true,

    }, {
      path: '/home',
      name: 'Home',
      component: Home,
      /*children:[
        {
          path: '/test1',
          name: 'Test1',
          component: Test1
        },{
          path: '/test2',
          name: 'Test2',
          component: Test2
        },
      ]*/
      children: [
        {
          path: '/chat',
          name: '在线聊天',
          component: FriendChat,
          hidden: true
        },
      ]
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),
      hidden: true
    }
  ]
})
